<?php


/*********************************************/
/**                                         **/
/**        USER CONFIGURATION START         **/
/**                                         **/
/*********************************************/

$GLOBALS['_SEARCH_HTML_WEBSITES'] = array(
);
$GLOBALS['_SEARCH_HTML_DEPTH'] = 3;
$GLOBALS['_SEARCH_CACHE_LENGTH'] = 1;
$GLOBALS['_SEARCH_ALL_IGNORE'] = array(
	"#~$#",
	"#/\.#",
	"#/\.ht#",
	"#private#i",
	"#phpsearch_files#i",
	"#search\.php#i",
);


/*********************************************/
/**                                         **/
/**        USER CONFIGURATION END           **/
/**                                         **/
/*********************************************/








// advanced stuff below:

// any files found matching these links will be searched as well. 
// if you have PDF support the pdf contents will be searched as well :) 
$GLOBALS['_SEARCH_FILES_INCLUDE'] = array(
	"#\.jpg$#i",
	"#\.jpeg$#i",
	"#\.gif$#i",
	"#\.png$#i",
	"#\.exe$#i",
	"#\.pdf$#i",
	"#\.zip$#i",
	"#\.doc$#i",
	"#\.docx$#i",
	"#\.avi$#i",
	"#\.mov$#i",
	"#\.mpg$#i",
	"#\.mpeg$#i",
);
// any content type matching these regex's will be indexed and searched
$GLOBALS['_SEARCH_HTML_INCLUDE'] = array(
	"#text/html#i",
);

// any content type matching these regex's will be downloaded and treated as a pdf, converted to text, and indexed
// (if supported by server software)
$GLOBALS['_SEARCH_PDF_INCLUDE'] = array(
	"#application/pdf#i",
);

// nfi why i've used globals instead of define ... meh. same dif.
// min number of characters in search string.
$GLOBALS['_SEARCH_MIN_CHARS'] 			= 4; 
$GLOBALS['_SEARCH_SUMMARY_LENGTH'] 		= 110;
$GLOBALS['_SEARCH_PER_PAGE'] 			= 10;
$GLOBALS['_SEARCH_SHOW_BOX'] 			= true;
$GLOBALS['_SEARCH_SHOW_STYLESHEET'] 	= true; // use the inbuilt stylesheet or not? ie: phpsearch.css
$GLOBALS['_SEARCH_COMBINE']				= true; // set this to false if results take long time
$GLOBALS['_SEARCH_FILES_FOLDER'] 		= "phpsearch_files/"; // end it in a slash. path from search.php has to be writable 
$GLOBALS['_SEARCH_CACHE_FOLDER'] 		= $GLOBALS['_SEARCH_FILES_FOLDER']."search_cache/"; // end it in a slash. path from search.php has to be writable 
$GLOBALS['_SEARCH_FILE_HEADER'] 		= $GLOBALS['_SEARCH_FILES_FOLDER'].'header.php'; // file that contains anything before search results
$GLOBALS['_SEARCH_FILE_FOOTER'] 		= $GLOBALS['_SEARCH_FILES_FOLDER'].'footer.php'; // file that contains anything after search results
define("_SEARCH_DEBUG",false);
define("_SEARCH_DEMO",false);
// advanced: comma separated list of callback functions to pull search results from. 
// Add your own if you would like to (eg:) pull results from a database as well as the default. 
// See search_sample_callback() for example usage.
$GLOBALS['_SEARCH_CALLBACKS'] 			= "search_sample_callback"; 
function search_sample_callback($keyword,$search_depth){
	if(!_SEARCH_DEMO)return false;
	// only search on the first iteration, not after splitting keyword up further.
	if($search_depth>0)return false;
	return array(
		"something" => array(
			"importance" => 0.7, // 1 will push result to the top.
			"title" => "Example PHP callback result", // main title to display, keyword wil be highlighted automatically.
			"summary" => "For advanced PHP users, you can inject results in with a callback function.", // summary text to display under search result, keyword highlighted in this.
			"url" => "http://google.com/search?q=".urlencode($keyword), // Url to display / take the user to when they click on a search result.
		),
	);
}